package cn.adviceclient.gui.click;

import cn.adviceclient.features.module.ModuleManager;
import cn.adviceclient.features.module.impl.render.ClickGui;
import cn.adviceclient.features.value.ColorSetting;
import cn.adviceclient.utility.render.RenderUtils;
import cn.adviceclient.utility.render.RoundedUtils;

import java.awt.*;

public class Component implements IComponent {

    private float x, y, width, height;
    private Color color = new Color(255,255,255,255);
    private int colorRGB = color.getRGB();

    public void drawBackground(Color color) {
        RenderUtils.drawRect(x, y, width, height, color.getRGB());
    }
    public void drawRoundBackground(Color color) {
        RoundedUtils.drawRound(x, y, width, height,3, color);
    }
    public boolean isHovered(float mouseX, float mouseY) {
        return mouseX >= x && mouseX <= x + width && mouseY >= y && mouseY <= y + height;
    }

    public boolean isHovered(float mouseX, float mouseY, float height) {
        return mouseX >= x && mouseX <= x + width && mouseY >= y && mouseY <= y + height;
    }

    public boolean isVisible() {
        return true;
    }

    public void setHeight(float height) {
        this.height = height;
    }

    public void setWidth(float width) {
        this.width = width;
    }

    public float getHeight() {
        return height;
    }

    public float getWidth() {
        return width;
    }

    public void setY(float y) {
        this.y = y;
    }

    public void setX(float x) {
        this.x = x;
    }

    public float getX() {
        return x;
    }

    public float getY() {
        return y;
    }

    public int getColorRGB() {
        return colorRGB;
    }
}
